/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.core.model;

import javacommon.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

import cn.org.rapid_framework.util.DateConvertUtils;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "SYS_YG")
public class SysYg extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "员工表";
	public static final String ALIAS_YGBH = "员工编号";
	public static final String ALIAS_NAME = "姓名";
	public static final String ALIAS_DEPTID = "部门id";
	public static final String ALIAS_ZW = "职务";
	public static final String ALIAS_TEL = "工作电话";
	public static final String ALIAS_EMAIL = "邮箱";
	public static final String ALIAS_ZT = "工作状态";
	public static final String ALIAS_PHONE = "手机";
	public static final String ALIAS_SZDD = "所在地点";
	public static final String ALIAS_SZFC = "上次所在风场";
	public static final String ALIAS_QWSJ = "前往时间";
	public static final String ALIAS_FHSJ = "返回时间";
	public static final String ALIAS_DEPTNAME = "部门名称";
	
//	date formats
	public static final String FORMAT_QWSJ = DATE_FORMAT;
	public static final String FORMAT_FHSJ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 员工编号       db_column: YGBH 
     */ 	
	@Length(max=32)
	private java.lang.String ygbh;
    /**
     * 姓名       db_column: NAME 
     */ 	
	@Length(max=50)
	private java.lang.String name;
    /**
     * 部门id       db_column: DEPTID 
     */ 	
	
	private Long deptid;
    /**
     * 职务       db_column: ZW 
     */ 	
	@Length(max=40)
	private java.lang.String zw;
    /**
     * 工作电话       db_column: TEL 
     */ 	
	@Length(max=50)
	private java.lang.String tel;
    /**
     * 邮箱       db_column: EMAIL 
     */ 	
	@Length(max=100)
	private java.lang.String email;
    /**
     * 工作状态       db_column: ZT 
     */ 	
	
	private java.lang.Long zt;
    /**
     * 手机       db_column: PHONE 
     */ 	
	@Length(max=50)
	private java.lang.String phone;
	
	/**
     * 所在地点       db_column: SZDD 
     */ 	
	
	private String szdd;
    /**
     * 所在风场       db_column: SCSZFC 
     */ 	
	
	private Long szfc;
    /**
     * 前往时间       db_column: QWSJ 
     */ 	
	
	private java.util.Date qwsj;
    /**
     * 返回时间       db_column: FHSJ 
     */ 	
	
	private java.util.Date fhsj;
	/**
     * 部门名称       db_column: DEPTNAME 
     */ 	
	@Length(max=100)
	private java.lang.String deptname;
	
	//columns END

	public SysYg(){
	}

	public SysYg(
		String ygbh
	){
		this.ygbh = ygbh;
	}

	

	public void setYgbh(String value) {
		this.ygbh = value;
	}
	
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "assigned")
	@Column(name = "YGBH", unique = true, nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getYgbh() {
		return this.ygbh;
	}
	
	@Column(name = "NAME", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	@Column(name = "DEPTID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getDeptid() {
		return this.deptid;
	}
	
	public void setDeptid(Long value) {
		this.deptid = value;
	}
	
	@Column(name = "ZW", unique = false, nullable = true, insertable = true, updatable = true, length = 40)
	public java.lang.String getZw() {
		return this.zw;
	}
	
	public void setZw(java.lang.String value) {
		this.zw = value;
	}
	
	@Column(name = "TEL", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getTel() {
		return this.tel;
	}
	
	public void setTel(java.lang.String value) {
		this.tel = value;
	}
	
	@Column(name = "EMAIL", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getEmail() {
		return this.email;
	}
	
	public void setEmail(java.lang.String value) {
		this.email = value;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 6)
	public java.lang.Long getZt() {
		return this.zt;
	}
	
	public void setZt(java.lang.Long value) {
		this.zt = value;
	}
	
	@Column(name = "PHONE", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getPhone() {
		return this.phone;
	}
	
	public void setPhone(java.lang.String value) {
		this.phone = value;
	}
	
	@Column(name = "SZDD", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public String getSzdd() {
		return this.szdd;
	}
	
	public void setSzdd(String value) {
		this.szdd = value;
	}
	
	@Column(name = "SZFC", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public Long getSzfc() {
		return this.szfc;
	}
	
	public void setSzfc(Long value) {
		this.szfc = value;
	}
	
	@Transient
	public String getQwsjString() {
		return DateConvertUtils.format(getQwsj(), FORMAT_QWSJ);
	}
	public void setQwsjString(String value) {
		setQwsj(DateConvertUtils.parse(value, FORMAT_QWSJ,java.util.Date.class));
	}
	
	@Column(name = "QWSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getQwsj() {
		return this.qwsj;
	}
	
	public void setQwsj(java.util.Date value) {
		this.qwsj = value;
	}
	
	@Column(name = "DEPTNAME", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getDeptname() {
		return this.deptname;
	}
	
	public void setDeptname(java.lang.String value) {
		this.deptname = value;
	}
	
	@Transient
	public String getFhsjString() {
		return DateConvertUtils.format(getFhsj(), FORMAT_FHSJ);
	}
	public void setFhsjString(String value) {
		setFhsj(DateConvertUtils.parse(value, FORMAT_FHSJ,java.util.Date.class));
	}
	
	@Column(name = "FHSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getFhsj() {
		return this.fhsj;
	}
	
	public void setFhsj(java.util.Date value) {
		this.fhsj = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Ygbh",getYgbh())
			.append("Name",getName())
			.append("Deptid",getDeptid())
			.append("Zw",getZw())
			.append("Tel",getTel())
			.append("Email",getEmail())
			.append("Zt",getZt())
			.append("Phone",getPhone())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getYgbh())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SysYg == false) return false;
		if(this == obj) return true;
		SysYg other = (SysYg)obj;
		return new EqualsBuilder()
			.append(getYgbh(),other.getYgbh())
			.isEquals();
	}
	
	private String dataname;
	private String fcmc;
	private String key;
	
	@Transient
	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Transient
	public String getFcmc() {
		return fcmc;
	}

	public void setFcmc(String fcmc) {
		this.fcmc = fcmc;
	}

	@Transient
	public String getDataname() {
		return dataname;
	}

	public void setDataname(String dataname) {
		this.dataname = dataname;
	}

}

